const Mock = require('mockjs')


const data = Mock.mock({
    "list|2": [{
        name: '@cname',
        tel: /^1[3-9]\d{9}$/,
        city: '@city(true)',
        county: '@county',
        isDefault: false
    }],
    "goods|20": [{
        img: '@image(100x100,@color)',
        id: '@id',
        title: '@ctitle(20,50)',
        "price|1-100.2": 0,
        "num|1000-100000": 0
    }]
})
console.log(data);



module.exports = {
    devServer: {
        before(app) {
            app.get('/getAddress', (req, res) => {
                    res.send(data.list)
                }),
                app.get('/goods', (req, res) => {
                    res.send(data.goods)
                })
        }
    }
}